#ifndef _atomic_0822_data_collection_service_H_
#define _atomic_0822_data_collection_service_H_

/*------------------------ Include Begin --------------------------*/

// C
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <math.h>
#include <time.h>
#include <ctype.h>

// C++
#include <iostream>
#include <fstream>
#include <chrono>
#include <string>
#include <random>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <stdint.h>
#include <cctype> // for size_t
#include <sstream>

/*------------------------  Include End  -------------------------*/

/*------------------------  Service Info Begin  --------------------------*/
/**
 *
 * @name:     atomic_0822_data_collection_service
 * @chinese_name: 数据采集服务
 * @description: information atomic_0822_data_collection_service
 * @version: V1.0.0
 * @build_time: 2025-08-13 16:00:00
 * @license: MIT
 * @service_path: atomic_0822_data_collection_service
 *
 * @resource_requirement:
 *         + cpu_architecture: x86_64
 *         + memory: 4GB
 *         + hard_disk: 50GB
 *
 * @developer:
 *      +name: twilight
 *      +email: twilight@atomic_0822_data_collection_service.com
 * @maintainer:
 *      +name: twilight
 *      +email:twilight@atomic_0822_data_collection_service.com
 * @operating_system:
 *      +name:Linux
 *      +v1:5.13.0-117-generic
 *      +v2:5.14.0-117-generic
 *      +name:SylixOS
 *      +v1:1.0.0
 *      +v2:1.0.2
 *
 *
 *
 */
/*------------------------  Service Info End  --------------------------*/

/*------------------------  Return Type Begin  --------------------------*/

#define ATOMIC_SERVICE_SUCCESS 0
#define ATOMIC_SERVICE_FAIL -1
#define ATOMIC_SERVICE_TIMEOUT -2
#define ATOMIC_SERVICE_ERROR -3
#define ATOMIC_SERVICE_NOT_SUPPORT -4
#define ATOMIC_SERVICE_NOT_READY -5
#define ATOMIC_SERVICE_NOT_INIT -6
#define ATOMIC_SERVICE_NOT_START -7
#define ATOMIC_SERVICE_NOT_STOP -8
#define ATOMIC_SERVICE_NOT_RELEASE -9
#define ATOMIC_SERVICE_NOT_DESTROY -10
#define ATOMIC_SERVICE_NOT_CREATE -11
#define ATOMIC_SERVICE_NOT_OPEN -12
#define ATOMIC_SERVICE_NOT_CLOSE -13
#define ATOMIC_SERVICE_NOT_READ -14
#define ATOMIC_SERVICE_NOT_WRITE -15
#define ATOMIC_SERVICE_NOT_SEEK -16
#define ATOMIC_SERVICE_NOT_TELL -17
#define ATOMIC_SERVICE_NOT_SIZE -18
#define ATOMIC_SERVICE_NOT_SEEK_END -19
#define ATOMIC_SERVICE_NOT_SEEK_SET -20
#define ATOMIC_SERVICE_NOT_SEEK_CUR -21
#define ATOMIC_SERVICE_NOT_SEEK_ABS -22

/*------------------------  Return Type End  --------------------------*/


/*------------------------  Message Info Begin  --------------------------*/


// 采集输入参数
typedef struct {
    int device_id;             // 设备ID
    int collect_type;  // 采集类型
    int sample_rate;           // 采样率(Hz)
    int data_length;           // 期望数据长度
    int real_time_mode;       // 是否实时模式,1为是,0为否
} DataCollectionInput;

// 采集输出结果（仅使用基础数据类型）
typedef struct {
    
    int device_id;             // 设备ID
    int signal_type;           // 信号类型（0-4，见上方注释）
    int algo_type;             // 预处理算法类型（0-4，见上方注释）
    double raw_val1;           // 原始数据值1
    double raw_val2;           // 原始数据值2
    double raw_val3;           // 原始数据值3
    int valid_count;           // 有效数据数量
    int window_size;           // 滤波窗口大小（仅滤波算法用）
    double min_threshold;      // 最小值阈值（限幅/归一化用）
    double max_threshold;      // 最大值阈值（限幅/归一化用）
    int real_time_mode;       // 是否实时处理模式，1为是,0为否
    
} DataCollectionOutput;

/*------------------------  Message Info End  --------------------------*/


/*------------------------  Interface Declaration Begin  --------------------------*/

// 采集数据
int collectData(DataCollectionInput *input, DataCollectionOutput *output);


/*------------------------  Interface Declaration End  --------------------------*/


#endif // _atomic_0822_data_collection_service_H_
